From: Colin Walters Date: Fri, 25 Aug 2023 20:58:44 +0000 (-0400) Subject: switchroot: Use g_new/g_free consistently X-Git-Tag: archive/raspbian/2023.7-3+rpi1^2~16^2^2~41^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=1a16a7d6845d36c0810963f75243ad43ea69c593;p=ostree.git switchroot: Use g_new/g_free consistently Coverity complains about this, even though they're the same thing. --- diff --git a/src/libotcore/otcore-prepare-root.c b/src/libotcore/otcore-prepare-root.c index 189c2a14..f7523ef6 100644 --- a/src/libotcore/otcore-prepare-root.c +++ b/src/libotcore/otcore-prepare-root.c @@ -82,12 +82,12 @@ otcore_get_ostree_target (const char *cmdline, char **out_target, GError **error { if (strcmp (slot_suffix, "_a") == 0) { - *out_target = strdup (slot_a); + *out_target = g_strdup (slot_a); return TRUE; } else if (strcmp (slot_suffix, "_b") == 0) { - *out_target = strdup (slot_b); + *out_target = g_strdup (slot_b); return TRUE; } return glnx_throw (error, "androidboot.slot_suffix invalid: %s", slot_suffix); @@ -98,7 +98,7 @@ otcore_get_ostree_target (const char *cmdline, char **out_target, GError **error */ if (proc_cmdline_has_key_starting_with (cmdline, "androidboot.")) { - *out_target = strdup (slot_a); + *out_target = g_strdup (slot_a); return TRUE; } diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 05cef492..203722da 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -247,8 +247,8 @@ static void free_composefs_config (ComposefsConfig *config) { g_ptr_array_unref (config->pubkeys); - free (config->signature_pubkey); - free (config); + g_free (config->signature_pubkey); + g_free (config); } G_DEFINE_AUTOPTR_CLEANUP_FUNC (ComposefsConfig, free_composefs_config)